define(
	[	
		'require',
		'broada/ui/dialog',
		'apm/ui/business_sequence',
		'apm/ui/business_graduation',
		'apm/jquery.fullscreen'
	],
	function(require){
		var View = Ember.View.extend({
			Dialog: require('broada/ui/dialog'),
			Graduation: require('apm/ui/business_graduation'),
			Sequence: require('apm/ui/business_sequence'),
			didInsertElement: function(){
			},
			
			adjustTopoHeight: function(){
				var headerHeight = 68;
				if($.isFullScreen()){
					headerHeight = 0;
				}
				var appboxHeight = $(window).height()-headerHeight;
				var $topo = this.$().find(".business-overview-fullScreen");
					// $topoContainer = $topo.find(".topo-container");

				if($("body").hasClass("fullscreen")){
					$topo.height($(window).height() - 20);
				}
				else{
					$topo.height(appboxHeight-138);
				}
				// $topoContainer.height($topo.height()-10-this.$().find(".business-detail-gauge-extra").height());
			},
			actions: {
				fullScreen: function(){
					var ctrl = this;
					window.onresize = function (){
					    if( ($(window).outerWidth() == $(".business-overview-fullScreen").outerWidth())){
					    	$(".business-overview-setwrap").hide();	    
					    	$(".business-overview-fullScreen .btn-group").hide();
					    	$(".business-overview-fullScreen").removeClass("fullscreen-transparent").addClass("fullscreen-full");
					       ctrl.get("controller").set("isFull",true);
					       $(".business-main-title").addClass("fullscreen-title");
					    }else{
					    	$(".business-overview-fullScreen .btn-group").show();
					    	$(".business-overview-setwrap").show();
					       ctrl.get("controller").set("isFull",false);
					       if($(".business-overview-fullScreen").hasClass("fullscreen-full")){
					       		$(".business-overview-fullScreen").removeClass("fullscreen-full").addClass("fullscreen-transparent");
					       }
					       $(".business-main-title").removeClass("fullscreen-title");
					    }
					}
	
					if (!$.support.fullscreen) {
						$("body").toggleClass("fullscreen");
						this.adjustTopoHeight();
					}
					else{
						$(".business-overview-fullScreen").fullScreen();
					}
				}
			}
		});

		APM.BusinessOverviewView = View;

		return View;
	}
);